import request from '@/utils/request'

// 查询流程图
export function getBpmnResource(modelId) {
  return request({
    url: `/workflow/model/json/${modelId}`,
    method: 'get',
  })
}

// 保存流程图绘制
export function saveBpmnResource(data) {
  data.xml = data.xml.replace(/camunda/ig,"activiti")
    .replace(new RegExp("camunda.org/schema/1.0/bpmn",'ig'),"activiti.org/bpmn")
  return request({
    url: `/workflow/model/saveBpmnResource`,
    method: 'post',
    data: data
  })
}
